<?php
namespace RMD\AccountBundle\Entity;

use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;

class Condition
{
	const EQUAL = 2;		//=
	const NOT_EQUAL = 3;	//!=
	const LESS = 4;			//<
	const GREATER = 5;		//>
	private $id;
	private $segment_id;
	private $tableName;	
	private $columnName;	
	private $matchValue;	
	private $statement;	

	protected $segment;

	public function __construct() {
	}

	public static function loadValidatorMetadata(ClassMetadata $metadata)
    {
		$metadata->addPropertyConstraint('statement', new Assert\Choice(array(
            'choices' => array(self::EQUAL, self::NOT_EQUAL, self::LESS, self::GREATER),
            'message' => 'Invalid statement type',
        )));
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set segment_id
     *
     * @param integer $segmentId
     * @return Condition
     */
    public function setSegmentId($segmentId)
    {
        $this->segment_id = $segmentId;
    
        return $this;
    }

    /**
     * Get segment_id
     *
     * @return integer 
     */
    public function getSegmentId()
    {
        return $this->segment_id;
    }

    /**
     * Set tableName
     *
     * @param string $tableName
     * @return Condition
     */
    public function setTableName($tableName)
    {
        $this->tableName = $tableName;
    
        return $this;
    }

    /**
     * Get tableName
     *
     * @return string 
     */
    public function getTableName()
    {
        return $this->tableName;
    }

    /**
     * Set columnName
     *
     * @param string $columnName
     * @return Condition
     */
    public function setColumnName($columnName)
    {
        $this->columnName = $columnName;
    
        return $this;
    }

    /**
     * Get columnName
     *
     * @return string 
     */
    public function getColumnName()
    {
        return $this->columnName;
    }

    /**
     * Set matchValue
     *
     * @param string $matchValue
     * @return Condition
     */
    public function setMatchValue($matchValue)
    {
        $this->matchValue = $matchValue;
    
        return $this;
    }

    /**
     * Get matchValue
     *
     * @return string 
     */
    public function getMatchValue()
    {
        return $this->matchValue;
    }

    /**
     * Set statement
     *
     * @param integer $statement
     * @return Condition
     */
    public function setStatement($statement)
    {
        $this->statement = $statement;
    
        return $this;
    }

    /**
     * Get statement
     *
     * @return integer 
     */
    public function getStatement()
    {
        return $this->statement;
    }

    /**
     * Set segment
     *
     * @param \RMD\AccountBundle\Entity\Segment $segment
     * @return Condition
     */
    public function setSegment(\RMD\AccountBundle\Entity\Segment $segment = null)
    {
        $this->segment = $segment;
    
        return $this;
    }

    /**
     * Get segment
     *
     * @return \RMD\AccountBundle\Entity\Segment 
     */
    public function getSegment()
    {
        return $this->segment;
    }
}